package cn.itsource.basic.util;


import cn.hutool.http.HttpUtil;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
public class PhoneUtil {

    public static void email1(String phone,StringBuilder code){
        Map<String, Object> map = new HashMap<>();
        map.put("Uid", "致明日的");
        map.put("Key", "d41d8cd98f00b204e980");
        map.put("smsMob", phone);
        map.put("smsText", "【验证码：】"+code);
        String s = HttpUtil.post("http://utf8.api.smschinese.cn", map);
        System.out.println(s);
    }
    public static void email2(String phone,String name,String username){
        Map<String, Object> map = new HashMap<>();
        map.put("Uid", "致明日的");
        map.put("Key", "d41d8cd98f00b204e980");
        map.put("smsMob", phone);
        map.put("smsText", "【宠物乐园：】:你好"+name+"，我们今天会派遣"+username+"员工去收购您的爱宠，如果有时间请回复1");
        System.out.println(map.get("smsText"));
    }

}
